<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/index/css/style.css"/>
    <script type="text/javascript" src="__STATIC__/index/js/rem.js"></script>
    <title>我的积分</title>
</head>
<body class="geryBg">
<div class="integral">
    <div class="integral_code white">
        <h1 class="score text-center" style="font-size: 1rem">{$sum}</h1>
        <button class="discounting">去抵现</button>
        <a href="rule"><i class="integral_rule white">积分规则 >></i></a>
    </div>
    <!--积分支出 选项卡-->
    <div class="integral_nav whiteBg smoth bold">
        <ul class="nav_list clear">
            <li class="fl on">积分收入</li>
            <li class="fr">积分支出</li>
        </ul>
    </div>
    <!--积分收入表-->
    <div class="integral_expend whiteBg block">
        {foreach $inc as $vo}
        <div class="expend_list clear">
            <div class="fl">
                <p class="smoth super-text bold">
                    {if $vo.type==1}分享
                    {elseif $vo.type==2}购买馈赠
                    {elseif $vo.type==3}办卡
                    {elseif $vo.type==5}退货退还
                    {/if}
                </p>
                <p class="lightgery normall-text time">{$vo.create_at}</p>
            </div>
            <div class="fr">
                <p class="brown super-text score_detail">+{$vo.jifen}</p>
            </div>
        </div>
        {/foreach}
    </div>
    <!--积分支出表-->
    <div class="integral_expend whiteBg">
        {foreach $dec as $v}
        <div class="expend_list clear">
            <div class="fl">
                <p class="smoth super-text bold">支付抵扣</p>
                <p class="lightgery normall-text time">{$v.create_at}</p>
            </div>
            <div class="fr">
                <p class="super-text score_detail">-{$v.jifen}</p>
            </div>
        </div>
        {/foreach}
    </div>
</div>
<script type="text/javascript" src="__STATIC__/index/js/jquery-1.11.2.min.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
<script type="text/javascript">
    //切换选项卡
    $('.nav_list li').on('click', function () {
        $(this).addClass('on').siblings().removeClass('on')
        var index = $(this).index()//获取选项的下标
        $('.integral .integral_expend').eq(index).addClass('block').siblings().removeClass("block")//遍历切换
    })
    //跳转到首页
    $('.discounting').on('click', function () {
        window.location.href = '/index/shop/index';
    })

    wx.config({$jsSign|raw});
    wx.ready(function () {
        wx.onMenuShareAppMessage({
            title: '{:conf("share_friend_title")}', // 分享标题
            desc: '{:conf("share_friend_dec")}', // 分享描述
            link: '{$Request.domain}/index/shop/index', // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
            imgUrl: '{:conf("share_friend_img")}', // 分享图标
            type: '', // 分享类型,music、video或link，不填默认为link
            dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
            success: function () {
                $.ajax({
                    url:'share',
                    type:'post',
                    success:function (res) {
                        window.location.reload();
                    }
                })
            }
        });

        wx.onMenuShareTimeline({
            title: '{:conf("share_title")}', // 分享标题
            link: '{$Request.domain}/index/shop/index', // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
            imgUrl: '{:conf("share_img")}', // 分享图标
            success: function () {
                $.ajax({
                    url:'share',
                    type:'post',
                    success:function () {
                        window.location.reload();
                    }
                })
            }
        });
    })


</script>
</body>
</html>